#ifndef __FINDBAR_H__
#define __FINDBAR_H__

#include <QtGui>

class FindBar : public QFrame
{
    Q_OBJECT
public:
    FindBar(QWidget *parent = 0, Qt::WFlags f = 0 );
    void focusSearch() { find->setFocus(); }
private:
    // WIDGETS;
    QLineEdit *find;
    QCheckBox *matchcase;
    QPushButton *findprevious, *findnext;
    QWidget *m_parent;
    
    // DATA MEMBERS;
    QString m_search;
    QPalette old;
    bool m_loading;
    Qt::WFlags m_flags;

public slots:
    void textChanged(QString);
    void textFound(bool);
    void doEsc();
    void load();
    void doFindNext();
    void doFindPrevious();
    void doStateChanged(int);

signals:
    void newSearchText(QString s, bool forward = true, bool mcase = false);
    void requestFindNext(bool);
    void requestFindPrevious(bool);
    void findBarHidden(bool);
};

#endif // __FINDBAR_H__
